﻿import QtQuick
import QtQuick.Layouts
import QtQuick.Window
import QtQuick.Controls
import QtCore
import FilUI

import "../controls"

FilScrollablePage {
    id: control

    property int rightScrollableMargin: 17
    property int frameSpacing: 12

    FilFrame {
        Layout.fillWidth: true
        Layout.rightMargin: control.rightScrollableMargin
        padding: 10
        ColumnLayout {
            FilText {
                text: qsTr("Help Manual")
                font: FilTextStyle.BodyStrong
            }
            FilTextButton {
                text: qsTr("Open in browser")
                horizontalPadding: 0
                backgroundHoverColor: FilTheme.itemNormalColor
                backgroundPressedColor: FilTheme.itemNormalColor
                onHoveredChanged: {
                    if (!hovered) {
                        FilTools.restoreOverrideCursor()
                    } else {
                        FilTools.setOverrideCursor(Qt.PointingHandCursor)
                    }
                }
                onClicked: {
                    Qt.openUrlExternally("https://gitee.com/time--chicken/SecAssistPro/blob/main/res/help_zh_CN.md")
                }
            }
        }
    }

    FilFrame {
        Layout.fillWidth: true
        Layout.rightMargin: control.rightScrollableMargin
        padding: 10
        ColumnLayout {
            FilText {
                text: qsTr("Tour")
                font: FilTextStyle.BodyStrong
            }
            FilButton {
                text: qsTr("Reset")
                onClicked: {
                    TourTools.clearAll()
                    showInfo(qsTr("Tour reset successfully"), 2000)
                }
            }
        }
    }
}
